
public class Problem2 {
	public static void main(String[] args) {
		System.out.println(solve());
	}

	public static long solve() {
		int n = 4000000;
		
		long res = 0;
		int fib1 = 1, fib2 = 2;
		while (fib2 <= n) {
			int fib3 = fib1 + fib2;
			if (fib2 % 2 == 0) {
				res += fib2;
			}
			fib1 = fib2;
			fib2 = fib3;
		}
		return res;
	}
}
